Cleaning the code according to new logout behavior in TOOLKIT