working on refactoring so it's more modular