Refactoring: gl bug fix