Cleaned up and separated buffer class from test cases.