switch type check to isinstance formula