more cleanup and fixes