refactored template-initialization/update