Refactor the index and abstract out to specific files
Merge from master
Merge branch 'master' into unit_testing