refactor auto update/insert rules