some minor style and performance improvements