Lots of cleanup prior to merge