moved all SQL queries into single Database module

Got it.