minor enhancements
some optimizations