refactor Prefer header generation