Refacroting for future separation of game and rendering engine.