Refactor importer and sample indexing