Perhaps this logic should live in `BaseView`.