cleaned up event edit code