refactoring model
adding more tests