More cleanup. Sara suggested a change that should make some of the code much more straightforward.