Use BufUtil.retain() where possible