more cleanup and simplification