more cleanup and tiny fixes