Modification in response to code review from @kcooney and @dsaff.