multiple tweaks and improvements