writing model tests for users
refactoring some code, adding more tests