Most cleanup done, routines consolidated