implement Database class