general cleanup and improvements