Refactor user and addded more tests and coverage.