Added dependency injection using interfaces.