refactor dae.py