Moved DB connection to class