save rules/sets in tree structure