Move previous to util.py