Refactored project to be testable