database rebuild in DB.class and other related changes