made the database interface a class