Created model User. Refactored code