buffer processing implementation