Refactored helper to use views.