misc cleanup and simplification