gl helper implementation