Some code cleanup per Dylan's comments.