Move output generation to bin file