change closure binding visibility, & some cleanup