move game and rendering to class