Extracted game logic to engine class and Refactored command