Standardized events. Added switch functionality.