Added dependency injection support for template base class