Added and and or chaining for restrictiongroup, reorganized a bit