Refactored to seperate out the different readers and writers into a nice
type hierarchy