Added dependency injection, NOT TESTED YET