refactoring and comments in Simulator