refactored CommandProcessorFactory