refactors index again