changing index module structure so easier to test