adding comment explaining why instanceof check was replaced