renamed reader to sorter

split off parsing into new function