lots of tweaks & performance improvements