Refactoring buffer config