refactoring QPBO