Cleaning up a bit - there's still more to do but this looks like things are getting put in the right places.