refactor resources