Added logging, database classes