refactor: extract common code
refactor: extract common code

weaveworks/scope,kinvolk/scope,alban/scope,kinvolk/scope,alban/scope,weaveworks/scope,weaveworks/scope,alban/scope,alban/scope,weaveworks/scope,weaveworks/scope,alban/scope,kinvolk/scope,kinvolk/scope,weaveworks/scope,alban/scope,kinvolk/scope,kinvolk/scope