If it was done in January, it would have been justifiable to say he wanted a fresh start with a director who didn't impose himself into the election and had lost credibility on his impartiality. To do it now, when the reasons given to fire him were there in January, and after Trump praised Comey's actions days before the election, indicates that Trump is worried that the FBI is getting close on the Russian connection, and the Yates testimony must have rattled him and pursuaded him to act now. And if Obama had fired Comey, the Republicans would have been screaming about a coverup.
This is the first time in history that an FBI director was fired by the administration they were actively investigating. When Clinton fired the FBI director, it was after an independent investigation found the director had misappropriated funds, and was supported by both Dems and Repubs.