abstracted db verification to a function call