refactoring of Resource and Document url helpers