refactoring of commands