Code cleanup based on bshaffer's review.