refactored user.py