reform dmtable.py