I would probably just make this a method of the State class, or move it into the ``utils.py`` file.