Code cleanup in Db class