Why not to check `current_class != None` first, then check `script_type`?