added support for xsaas token
cleaned up