restructure eos.py