cleanup and optimizations
fixes and updates