Refactoring for DI
Unit tests