modularized the reading process a little