refactoring work on simulation