implemented is_type
rename rules for rewriting