LPS-50811 Extract logic to reusable public class