refactoring for qbv2