refactor to use *bytes.Reader as anonymous field