added match info, refactored code