Refactor imports in utils.py.