cleanup and simplification