LPS-43062 abstract out common code