Move logics which builds indices to own constructors