working with template magic