some cleanup of simulation run code