More work on db class