Tidying up simulation code.