Replaced .class comparison with .is_a?