@goaway's code review revisions.