Tweaks and optimizations