ENYO-266: Factor out rebuilding of selected indices.

Enyo-DCO-1.1-Signed-off-by: Aaron Tam <aaron.tam@lge.com>