improve(?) template-fn by factoring out some logic into separate functions
make functions that aren't intended to be public, private