refactoring glass build from scratch