Improve the match mode