diff --git a/src/library.liq b/src/library.liq
index e9a98aa67013d6e4b634b153ded964a837a84812..ea93e931f85c6f826b73fc66395054c6f4a6f5ea 100644
--- a/src/library.liq
+++ b/src/library.liq
@@ -72,47 +72,29 @@ def stream_to_icecast(id, encoding, bitrate, host, port, pass, mount_point, url,
         log("Successfully connected to stream_#{streamnumber}")
     end
 
-    stereo = (int_of_string(channels) >= 2)
-
     user_ref = ref (user)
     if user == "" then
         user_ref := "source"
     end
 
-    # Liquidsoap cannot handle one output definition for mono and stereo
-    output_icecast_mono   = output.icecast(id = id, host = host, port = port, password = pass, mount = mount_point, fallible = true, url = url, description = description, name = name, genre = genre, user = !user_ref, on_error = on_error, on_connect = on_connect, icy_metadata = "true")
-    output_icecast_stereo = output.icecast(id = id, host = host, port = port, password = pass, mount = mount_point, fallible = true, url = url, description = description, name = name, genre = genre, user = !user_ref, on_error = on_error, on_connect = on_connect, icy_metadata = "true")
-
-#    %ifencoder %aac
-#    if encoding == "aac" then
-#        log("ENABLING AAC to ICECAST")
-#        %include "outgoing_streams/aac.liq"
-#    end
-#    %endif
-#
-#    %ifencoder %flac
-#    if encoding == "flac" then
-#        log("ENABLING FLAC to ICECAST")
-#        %include "outgoing_streams/flac.liq"
-#    end
-#    %endif
-
+    # TODO Refactor all outgoing stream formats this way
+    let stereo = (int_of_string(channels) >= 2)
+    let format = %mp3(bitrate = 128, stereo = true)
     if encoding == "mp3" then
-        log("ENABLING MP3 to ICECAST")
         %include "outgoing_streams/mp3.liq"
     end
-
     if encoding == "ogg" then
-        log("ENABLING OGG to ICECAST")
         %include "outgoing_streams/ogg.liq"
     end
 
-#    %ifencoder %opus
-#    if encoding == "opus" then
-#        log("ENABLING OPUS to ICECAST")
-#        %include "outgoing_streams/opus.liq"
-#    end
-#    %endif
+    log("Icecast output format: #{encoding} #{bitrate}")
+    # Liquidsoap cannot handle one output definition for mono and stereo
+    # FIXME should be working since Liquidsoap 2
+    output_icecast_mono   = output.icecast(id = id, host = host, port = port, password = pass, mount = mount_point, fallible = true, url = url, description = description, name = name, genre = genre, user = !user_ref, on_error = on_error, on_connect = on_connect, icy_metadata = "true", format, !source)
+    output_icecast_stereo = output.icecast(id = id, host = host, port = port, password = pass, mount = mount_point, fallible = true, url = url, description = description, name = name, genre = genre, user = !user_ref, on_error = on_error, on_connect = on_connect, icy_metadata = "true", format, !source)
+    ignore(output_icecast_mono)
+    ignore(output_icecast_stereo)
+
 end
 
 ###########
diff --git a/src/outgoing_streams/mp3.liq b/src/outgoing_streams/mp3.liq
index 70218feb23b94ce3dd6bf6615353864656e5e96a..8f8ce70d74cb107df99546f1310807c6c3e83045 100644
--- a/src/outgoing_streams/mp3.liq
+++ b/src/outgoing_streams/mp3.liq
@@ -19,69 +19,91 @@
 
 if bitrate == 24 then
     if stereo then
-        ignore(output_icecast_stereo(%mp3(bitrate = 24, stereo = true), !source))
+        format = %mp3(bitrate = 24, stereo = true)
+        ignore(format)
     else
-        ignore(output_icecast_mono(%mp3(bitrate = 24, stereo = false), mean(!source)))
+        format = %mp3(bitrate = 24, stereo = false)
+        ignore(format)
     end
 elsif bitrate == 32 then
     if stereo then
-        ignore(output_icecast_stereo(%mp3(bitrate = 32, stereo = true), !source))
+        format = %mp3(bitrate = 32, stereo = true)
+        ignore(format)
     else
-        ignore(output_icecast_mono(%mp3(bitrate = 32, stereo = false), mean(!source)))
+        format = %mp3(bitrate = 32, stereo = false)
+        ignore(format)
     end
 elsif bitrate == 48 then
     if stereo then
-        ignore(output_icecast_stereo(%mp3(bitrate = 48, stereo = true), !source))
+        format = %mp3(bitrate = 48, stereo = true)
+        ignore(format)
     else
-        ignore(output_icecast_mono(%mp3(bitrate = 48, stereo = false), mean(!source)))
+        format = %mp3(bitrate = 48, stereo = false)
+        ignore(format)
     end
 elsif bitrate == 64 then
     if stereo then
-        ignore(output_icecast_stereo(%mp3(bitrate = 64, stereo = true), !source))
+        format = %mp3(bitrate = 64, stereo = true)
+        ignore(format)
     else
-        ignore(output_icecast_mono(%mp3(bitrate = 64, stereo = false), mean(!source)))
+        format = %mp3(bitrate = 64, stereo = false)
+        ignore(format)
     end
 elsif bitrate == 96 then
     if stereo then
-        ignore(output_icecast_stereo(%mp3(bitrate = 96, stereo = true), !source))
+        format = %mp3(bitrate = 96, stereo = true)
+        ignore(format)
     else
-        ignore(output_icecast_mono(%mp3(bitrate = 96, stereo = false), mean(!source)))
+        format = %mp3(bitrate = 96, stereo = false)
+        ignore(format)
     end
 elsif bitrate == 128 then
     if stereo then
-        ignore(output_icecast_stereo(%mp3(bitrate = 128, stereo = true), !source))
+        format = %mp3(bitrate = 128, stereo = true)
+        ignore(format)
     else
-        ignore(output_icecast_mono(%mp3(bitrate = 128, stereo = false), mean(!source)))
+        format = %mp3(bitrate = 128, stereo = false)
+        ignore(format)
     end
 elsif bitrate == 160 then
     if stereo then
-        ignore(output_icecast_stereo(%mp3(bitrate = 160, stereo = true), !source))
+        format = %mp3(bitrate = 160, stereo = true)
+        ignore(format)
     else
-        ignore(output_icecast_mono(%mp3(bitrate = 160, stereo = false), mean(!source)))
+        format = %mp3(bitrate = 160, stereo = false)
+        ignore(format)
     end
 elsif bitrate == 192 then
     if stereo then
-        ignore(output_icecast_stereo(%mp3(bitrate = 192, stereo = true), !source))
+        format = %mp3(bitrate = 192, stereo = true)
+        ignore(format)
     else
-        ignore(output_icecast_mono(%mp3(bitrate = 192, stereo = false), mean(!source)))
+        format = %mp3(bitrate = 192, stereo = false)
+        ignore(format)
     end
 elsif bitrate == 224 then
     if stereo then
-        ignore(output_icecast_stereo(%mp3(bitrate = 224, stereo = true), !source))
+        format = %mp3(bitrate = 224, stereo = true)
+        ignore(format)
     else
-        ignore(output_icecast_mono(%mp3(bitrate = 224, stereo = false), mean(!source)))
+        format = %mp3(bitrate = 224, stereo = false)
+        ignore(format)
     end
 elsif bitrate == 256 then
     if stereo then
-        ignore(output_icecast_stereo(%mp3(bitrate = 256, stereo = true), !source))
+        format = %mp3(bitrate = 256, stereo = true)
+        ignore(format)
     else
-        ignore(output_icecast_mono(%mp3(bitrate = 256, stereo = false), mean(!source)))
+        format = %mp3(bitrate = 256, stereo = false)
+        ignore(format)
     end
 elsif bitrate == 320 then
     if stereo then
-        ignore(output_icecast_stereo(%mp3(bitrate = 320, stereo = true), !source))
+        format = %mp3(bitrate = 320, stereo = true)
+        ignore(format)
     else
-        ignore(output_icecast_mono(%mp3(bitrate = 320, stereo = false), mean(!source)))
+        format = %mp3(bitrate = 320, stereo = false)
+        ignore(format)
     end
 end
 
diff --git a/src/outgoing_streams/ogg.liq b/src/outgoing_streams/ogg.liq
index a8a6e624ef82c7c7be5018b2482ebe5014c2c948..7c790d1f76a078887914af93b3aca06b345d6108 100644
--- a/src/outgoing_streams/ogg.liq
+++ b/src/outgoing_streams/ogg.liq
@@ -23,57 +23,75 @@ end
 
 if bitrate == 24 or bitrate == 32 or bitrate == 48 then
     if stereo then
-        ignore(output_icecast_stereo(%vorbis(quality=-0.1, channels = 2), !source))
+        format = %vorbis(quality=-0.1, channels = 2)
+        ignore(format)
     else
-        ignore(output_icecast_mono(%vorbis(quality=-0.1, channels = 1), mean(!source)))
+        format = %vorbis(quality=-0.1, channels = 1)
+        ignore(format)
     end
 elsif bitrate == 64 then
     if stereo then
-        ignore(output_icecast_stereo(%vorbis(quality=0, channels = 2), !source))
+        format = %vorbis(quality=0, channels = 2)
+        ignore(format)
     else
-        ignore(output_icecast_mono(%vorbis(quality=0, channels = 1), mean(!source)))
+        format = %vorbis(quality=0, channels = 1)
+        ignore(format)
     end
 elsif bitrate == 96 then
     if stereo then
-        ignore(output_icecast_stereo(%vorbis(quality=0.2, channels = 2), !source))
+        format = %vorbis(quality=0.2, channels = 2)
+        ignore(format)
     else
-        ignore(output_icecast_mono(%vorbis(quality=0.2, channels = 1), mean(!source)))
+        format = %vorbis(quality=0.2, channels = 1)
+        ignore(format)
     end
 elsif bitrate == 128 then
     if stereo then
-        ignore(output_icecast_stereo(%vorbis(quality=0.4, channels = 2), !source))
+        format = %vorbis(quality=0.4, channels = 2)
+        ignore(format)
     else
-        ignore(output_icecast_mono(%vorbis(quality=0.4, channels = 1), mean(!source)))
+        format = %vorbis(quality=0.4, channels = 1)
+        ignore(format)
     end
 elsif bitrate == 160 then
     if stereo then
-        ignore(output_icecast_stereo(%vorbis(quality=0.5, channels = 2), !source))
+        format = %vorbis(quality=0.5, channels = 2)
+        ignore(format)
     else
-        ignore(output_icecast_mono(%vorbis(quality=0.5, channels = 1), mean(!source)))
+        format = %vorbis(quality=0.5, channels = 1)
+        ignore(format)
     end
 elsif bitrate == 192 then
     if stereo then
-        ignore(output_icecast_stereo(%vorbis(quality=0.6, channels = 2), !source))
+        format = %vorbis(quality=0.6, channels = 2)
+        ignore(format)
     else
-        ignore(output_icecast_mono(%vorbis(quality=0.6, channels = 1), mean(!source)))
+        format = %vorbis(quality=0.6, channels = 1)
+        ignore(format)
     end
 elsif bitrate == 224 then
     if stereo then
-        ignore(output_icecast_stereo(%vorbis(quality=0.7, channels = 2), !source))
+        format = %vorbis(quality=0.7, channels = 2)
+        ignore(format)
     else
-        ignore(output_icecast_mono(%vorbis(quality=0.7, channels = 1), mean(!source)))
+        format = %vorbis(quality=0.7, channels = 1)
+        ignore(format)
     end
 elsif bitrate == 256 then
     if stereo then
-        ignore(output_icecast_stereo(%vorbis(quality=0.8, channels = 2), !source))
+        format = %vorbis(quality=0.8, channels = 2)
+        ignore(format)
     else
-        ignore(output_icecast_mono(%vorbis(quality=0.8, channels = 1), mean(!source)))
+        format = %vorbis(quality=0.8, channels = 1)
+        ignore(format)
     end
 elsif bitrate == 320 then
     if stereo then
-        ignore(output_icecast_stereo(%vorbis(quality=0.9, channels = 2), !source))
+        format = %vorbis(quality=0.9, channels = 2)
+        ignore(format)
     else
-        ignore(output_icecast_mono(%vorbis(quality=0.9, channels = 1), mean(!source)))
+        format = %vorbis(quality=0.9, channels = 1)
+        ignore(format)
     end
 end
 
diff --git a/src/readini.liq b/src/readini.liq
index 9671aa57340611a3ff0250e3078648b5f905cdfd..64a3b2d87df87616db3186a4854d0553f8ec1813 100644
--- a/src/readini.liq
+++ b/src/readini.liq
@@ -28,7 +28,14 @@ def read_ini(file)
   # read ini file
   settings_file_content = process.read.lines("cat "^file )
   # one entry stored as ["setting_name", "setting"]
-  settings_map = list.map(string.split(separator="="), settings_file_content)
+  # settings_map = list.map(string.split(separator="="), settings_file_content)
+
+  def split_line(line)
+    string.split(line, separator="=")
+  end
+  settings_map = list.map(split_line, settings_file_content)
+
+  # settings_map = list.map(string.split("#{settings_file_content}", separator="="))
 
   def filter_pair(setting_pair) =
     if !debug then