Update code to reflect hdmoore's code review.