some cleanup and smaller changes