Implement token generation