refactoring Model, changing some tests