final cleanup and fixes