cleanup in openGL code