Splitted saveRule into insertRule and updateRule