cleanup, lots of enhancements