pulled out search space walk logic in dynamic fashion