Cleanup. Reduced duplication. Encapsulated token info into a struct.
Cleanup.