Relaced '==' with 'isAssignableFrom' for class comparisons