Use instanceof instead of method is_a

Since __is_a__ is a method, it is significantly slower than using instanceof

Following is a perfomance comparison:
http://micro-optimization.com/is_a-vs-instanceof