Refactoring move resourcetemplate to application