cleaning up simulation logic