Refactoring for more flexibility with resource urls