setup database from entities
removed unused code and entities