Template dynamic
Code refactoring