Move function into new utils.py file.