move ordered dict out of core.py