token rework
fixing tests
improve logging