Factor out buffer