Fix tight coupling in database manager