respond_to? is faster than comparing classes, it seems.