refactor template and it's values