Refactoring resource link generation.