Add codes for DBContract and updated other related files