moved database handling utility functions from test to database utility function file