Tidy up copyResource and copyTemplate methods