Refactor _mode rule