Refactored game engine classes