Refactors matches table