Added DI and more tests