refactoring + command simplification