Index file refactor