refactoring, more OpenGL code