Refactor Index