some refactoring to <usertoken> and <applicationtoken> changes