Modified code to make better use of set_user_prefix