major refactor for efficiency and support of buildit gem