Refactored and expanded link factoring to apply to non-gemini pages.