PyGlass related refactoring.