Make match engine a separate class