tweaks and optimizations