refactor to Simulator class