LPS-44910 Fixing small parameter passing problem and small refactor