Better modeling of db, now supports levels too