refactoring OpenGL-related classes