Address review comments for #1518

Deleted the branch for #1518, so addressing the review comments here.