refactor resource