State-based event modeling