moved all SQL queries into single Database module