resource refactor