extract the above buffer to its own class, that can be tested in isolation