Use isinstance, rather than direct type/class comparison