lots of cleanup mainly