//TODO make universal method for all templates