Refactor view helper