Created model
Refactoring code