train.py is modularized