MOD move some code to go-index package