outsourced Database Code to Database class