Modify utils/user.py to use list comprehensions instead of clunky loops