I would move the these routines to core/algorithms.py (not that we have more than one). in case you need helper functions will be easier