final fixes and improvements