Remove duplicated code
Shorten log message
Use separate struct for token