Refactored related content code
Small fix for related content