Refactoring & Usage of templates