Implemented factory for commands