Reworked fragment selection logic