Refactored code to make it more testable/readable
Ran build process