change "is_a" into "instanceof" which is a bit faster