refactor: introduce a helper to reduce duplication
refactor: introduce a helper to reduce duplication

paulbellamy/weave,n054/weave,weaveworks/weave,rade/weave,aaam/weave,tomwilkie/weave,paulbellamy/weave,tomwilkie/weave,dpw/weave,dpw/weave,weaveworks/weave,dpw/weave,tomwilkie/weave,n054/weave,aaam/weave,paulbellamy/weave,aaam/weave,aaam/weave,rade/weave,dpw/weave,n054/weave,tomwilkie/weave,weaveworks/weave,rade/weave,rade/weave,n054/weave,aaam/weave,dpw/weave,tomwilkie/weave,rade/weave,weaveworks/weave,n054/weave,paulbellamy/weave