sort by main and inner fragment in different packages