a few more optimizations
small tweaks