Improved event parsing