begin refactoring some of the opengl calls