Cleanup of the code so we can think about merging it.