some speed improvements
some more performance tweaks