separated the reader into an index object and scanner object