tweaks and performance fixes