removed some repeated code from reader. makes it more consistent and easier to follow.