implementation of game logic in separate class