Moved the index-functions to a new file.