Refactoring buffer controller