rewrite rules, remove some warnings