refactoring ogl