Added template setvice and unit-test