move some internal api to io.Reader method