Added some comments
Refactor: formater tpl code