Resource mergeSet proto

...and some minor code cleanup