refactoring for simulation

In the middle of the process