Refactor User class and add some comments