refactor into a single resource