Moved cube-drawing code to own class