Added logging, database class