refactored and continuting implementation for the CommandServiceHandler