Separate out the reading of the buffer into its own method