Refactor match model