xes pattern: make seamless, reduce duplicate code