I don't like this line, I'll take a look if it's possible to change it to `isinstance` check.