more small glm code refactors