Refactor the ViewSelectorHelper