refactor for qx 3