some cleanup and housekeeping