merge templates