lots of performance improvements