Moved functions from helpers.py to relevant sub-modules.