Moved processing token in its own method for cases, when we already have token, fetched from external location

-- Fixed undefined var err