established database as a separate class