Seems both are used in the code base but yes the `isinstance` is likely better