Use setdefault() to simplify initialization flow
Log SQL queries in Debug mode