Moved game rendering code into separate class