Clean up and refactor view helpers