Add logging, database class