performance tweaks, better extension handling and many other improvements