Fixes #47 : Refactor of selectSegmentsInSelection