performance cleanup

got rid of tag string and used instanceof