LPS-35908

Updated based on your refactoring, and merged/modified according to latest master:

LPS-36231, LPS-36369, LPS-36371, LPS-36372