made read functions use the same dispatching mechanism