refactor resouces