Implement event system.