per code review, fixup some stuff per Eli's suggestions to make it easier to read