Move common functions to utils.py
41