Refactor winning combination calculation