merge check for linked_products and reviews into a single else if statement