More refactoring, moved the GL version check to a separate method in anonymous namespace.