make duration of simulation configurable
a couple of code clean-up
fix typo caused migration not properly handled