some more cleanup and fixes