tiny tweaks and more optimization