Refactoring template xml