compiler: share bodies, groups and templates