class refactoring + commands method