Re-organized the database inheritance