Write unit-tests and use DI