extracting method for basestring compatibility