move template functions to utils for now