Improved database model, now with fewer orphans.