performance optimizations
fixes