more cleanup and comments