Added a bit more flexibility to token generation.