Refactor matcher and add spec for outer-container