Refactor policyView function