Segment indexes creation function a little improvement.