Refactoring callByToken() function.