Code cleanup, ready for review.