py2/3 use text_type instead of unicode
py2/3 use six.string_types instead of basestring