refactored game engine and game structure