LPS-33315 use dynamic query to better filter set of layouts
LPS-33315 Just keep the logic in the advice since it will most likely not be reused