[#1038] Redo templates for the functions in the logic layer