Move prepare and cleanup into same method