This block is apparently copied from that in `onLoad`; could they be factored out into a common `private` helper method?