changed approach and loop inside of templating UT #1024