RelatedPages: improve the way JS group is loaded