Refactor resources and references views