refactor buff size