pushed db logic into dbq