Change to is_a? Hash as per @orenyk's suggestion