cor buf refactor