improve buffer related