various tweaks and improvements