Classes for using database