LPS-51842 SF - move code closer to where it is used