Improved token generation.