Moved the logic for value search in the stack frame to a separate
object.