resources refactor part 1