Tidy up and changes to saveToken.