Database changes

Overall design ove database changed