Refactor on queue buf operations