Refactored WebGLHelper to hide internal function