Changes to db prototype and entity classes