Started working on unit tests
Added dependency injection points for testability