added command method in the factory which obviously returns the command