Changing model base clas and fixing tests