Refactor into indexing file metadata into the database controller