these functions are already in ``core/common.py``