Refactor view helpers