Dependency injection refactor (**breaks v 0.1 API**)