refactored project to make more modular