Moved a function def to a utils folder

Not critical to merge, just tidying up the place.