refactored user token implementation