Minor refactor to address @jsalvatier's comments.