Added dependency injection and container access - mostly tested