Some code cleanup on the OpenGL side