add support for string attributes
optimize scalar attribute dispatch