Refactoring in CommandHandlerImpl