separated index functions

separated out index functions - for reuse