What do you think about adding `isValid()` to `JSONMetric`, and then you can just iterate the list and call the method on each object instead of checking the type first?