     sy.push ""
                
     ###
-     * Entity Extensions
-    ###
-    ex.push ""
-    ###
      * Components List
     ###
-    ex.push "let isNull x = match x with null -> true | _ -> false"
-    ex.push "let notNull x = match x with null -> false | _ -> true"
-    ex.push ""
-    ex.push "type Component with "
+    sb.push ""
+    sb.push "    type Component with "
     kc = 0
     for Name, properties of config.components
       name = Name[0].toLowerCase()+Name[1...]
-      ex.push "    static member #{Name} with get() = #{++kc}"    
-    ex.push "    static member TotalComponents  with get() = #{++kc}"    
-    ex.push ""
-    ex.push "type ComponentId = "
-    kc = 0
-    for Name, properties of config.components
-      name = Name[0].toLowerCase()+Name[1...]
-      ex.push "  | #{Name} = #{++kc}"    
-    ex.push "  | TotalComponents = #{++kc}"    
-    ex.push ""
+      sb.push "        static member #{Name} with get() = #{++kc}"    
+    sb.push "        static member TotalComponents  with get() = #{++kc}"    
+    sb.push ""
   
     for Name, properties of config.components
       name = Name[0].toLowerCase()+Name[1...];
       switch properties
         when false
-          ex.push "type Entity with"     
-          ex.push ""
-          ex.push "    static member #{name}Component= new #{Name}Component()"
-          ex.push ""
-          ex.push "    member this.is#{Name}"
-          ex.push "        with get() ="
-          ex.push "            this.HasComponent(Component.#{Name})"
-          ex.push "        and  set(value) ="
-          ex.push "            if value <> this.is#{Name} then"
-          ex.push "                this.AddComponent(Component.#{Name}, Entity.#{name}Component) |> ignore"
-          ex.push "            else"
-          ex.push "                this.RemoveComponent(Component.#{Name}) |> ignore"
-          ex.push ""
-          ex.push "    member this.Is#{Name}(value) ="
-          ex.push "        this.is#{Name} <- value"
-          ex.push "        this"
-          ex.push ""
-          ex.push "type Matcher with "
-          ex.push "    static member #{Name} with get() = Matcher.AllOf(Component.#{Name}) "
-          ex.push ""
+          s1.push "    type Entity with"     
+          s1.push ""
+          s1.push "        static member #{name}Component= new #{Name}Component()"
+          s1.push ""
+          s1.push "        member this.is#{Name}"
+          s1.push "            with get() ="
+          s1.push "                this.HasComponent(Component.#{Name})"
+          s1.push "            and  set(value) ="
+          s1.push "                if value <> this.is#{Name} then"
+          s1.push "                    this.AddComponent(Component.#{Name}, Entity.#{name}Component) |> ignore"
+          s1.push "                else"
+          s1.push "                    this.RemoveComponent(Component.#{Name}) |> ignore"
+          s1.push ""
+          s1.push "        member this.Is#{Name}(value) ="
+          s1.push "            this.is#{Name} <- value"
+          s1.push "            this"
+          s1.push ""
+          s2.push "    type Matcher with "
+          s2.push "        static member #{Name}"
+          s2.push "            with get() = Matcher.AllOf(Component.#{Name}) "
+          s2.push ""
           
         else
-          ex.push "type Entity with"
-          ex.push "    member this.#{name}"
-          ex.push "        with get() = this.GetComponent(Component.#{Name}):?>#{Name}Component"
-          ex.push ""
-          ex.push "    member this.has#{Name}"
-          ex.push "        with get() = this.HasComponent(Component.#{Name})"
-          ex.push ""
-          ex.push "    member this._#{name}ComponentPool"
-          ex.push "         with get() = new Stack<#{Name}Component>()"
-          ex.push ""
-          ex.push "    member this.Clear#{Name}ComponentPool() ="
-          ex.push "        this._#{name}ComponentPool.Clear()"
-          ex.push ""
-          ex.push "    member this.Add#{Name}(#{params(properties)}) ="
-          ex.push "        let mutable c = "
-          ex.push "          match this._#{name}ComponentPool.Count with"
-          ex.push "          | 0 -> new #{Name}Component()"
-          ex.push "          | _ -> this._#{name}ComponentPool.Pop()"
+          s1.push "    type Entity with"
+          s1.push "        member this.#{name}"
+          s1.push "            with get() = this.GetComponent(Component.#{Name}):?>#{Name}Component"
+          s1.push ""
+          s1.push "        member this.has#{Name}"
+          s1.push "            with get() = this.HasComponent(Component.#{Name})"
+          s1.push ""
+          s1.push "        member this._#{name}ComponentPool"
+          s1.push "             with get() = new Stack<#{Name}Component>()"
+          s1.push ""
+          s1.push "        member this.Clear#{Name}ComponentPool() ="
+          s1.push "            this._#{name}ComponentPool.Clear()"
+          s1.push ""
+          s1.push "        member this.Add#{Name}(#{params(properties)}) ="
+          s1.push "            let mutable c = "
+          s1.push "              match this._#{name}ComponentPool.Count with"
+          s1.push "              | 0 -> new #{Name}Component()"
+          s1.push "              | _ -> this._#{name}ComponentPool.Pop()"
           for p in properties
-            ex.push "        c.#{p.split(':')[0]} <- #{p.split(':')[0]};"
-          ex.push "        this.AddComponent(Component.#{Name}, c)"
-          ex.push ""
-          ex.push "    member this.Replace#{Name}(#{params(properties)}) ="
-          ex.push "        let previousComponent = if this.has#{Name} then this.#{name} else null"
-          ex.push "        let mutable c = "
-          ex.push "          match this._#{name}ComponentPool.Count with"
-          ex.push "          | 0 -> new #{Name}Component()"
-          ex.push "          | _ -> this._#{name}ComponentPool.Pop()"
+            s1.push "            c.#{p.split(':')[0]} <- #{p.split(':')[0]};"
+          s1.push "            this.AddComponent(Component.#{Name}, c)"
+          s1.push ""
+          s1.push "        member this.Replace#{Name}(#{params(properties)}) ="
+          s1.push "            let previousComponent = if this.has#{Name} then this.#{name} else null"
+          s1.push "            let mutable c = "
+          s1.push "              match this._#{name}ComponentPool.Count with"
+          s1.push "              | 0 -> new #{Name}Component()"
+          s1.push "              | _ -> this._#{name}ComponentPool.Pop()"
           for p in properties
-            ex.push "        c.#{p.split(':')[0]} <- #{p.split(':')[0]};"
-          ex.push "        this.ReplaceComponent(Component.#{Name}, c) |> ignore"
-          ex.push "        if not(isNull(previousComponent)) then"
-          ex.push "            this._#{name}ComponentPool.Push(previousComponent)"
-          ex.push "        this"
-          ex.push ""
-          ex.push "    member this.Remove#{Name}() ="
-          ex.push "        let c = this.#{name}"
-          ex.push "        this.RemoveComponent(Component.#{Name}) |> ignore"
-          ex.push "        this._#{name}ComponentPool.Push(c)"
-          ex.push ""
-          ex.push "type Matcher with "
-          ex.push "    static member #{Name} with get() = Matcher.AllOf(Component.#{Name}) "
-          ex.push ""
+            s1.push "            c.#{p.split(':')[0]} <- #{p.split(':')[0]};"
+          s1.push "            this.ReplaceComponent(Component.#{Name}, c) |> ignore"
+          s1.push "            if not(isNull(previousComponent)) then"
+          s1.push "                this._#{name}ComponentPool.Push(previousComponent)"
+          s1.push "            this"
+          s1.push ""
+          s1.push "        member this.Remove#{Name}() ="
+          s1.push "            let c = this.#{name}"
+          s1.push "            this.RemoveComponent(Component.#{Name}) |> ignore"
+          s1.push "            this._#{name}ComponentPool.Push(c)"
+          s1.push ""
+          s2.push "    type Matcher with "
+          s2.push "        static member #{Name}"
+          s2.push "            with get() = Matcher.AllOf(Component.#{Name}) "
+          s2.push ""
           
     ###
      * Pooled Entities
     ###
-    ex.push "type World with"
+    s3.push "    type World with"
     for Name, pooled of config.entities
       if pooled
         name = Name[0].toLowerCase()+Name[1...];
         properties = config.components[Name]
         if config.components[Name] is false
-          ex.push ""
-          ex.push "    member this.#{name}Entity"
-          ex.push "        with get() = this.GetGroup(Matcher.#{Name}).GetSingleEntity()"
-          ex.push ""
-          ex.push "    member this.is#{Name}"
-          ex.push "        with get() ="
-          ex.push "            notNull(this.#{name}Entity)"
-          ex.push "        and  set(value) ="
-          ex.push "            let entity = this.#{name}Entity"
-          ex.push "            if value <> notNull(entity) then"
-          ex.push "                if value then"
-          ex.push "                    this.CreateEntity().is#{Name} <- true"
-          ex.push "                else"
-          ex.push "                    this.DestroyEntity(entity)"
-          ex.push ""
+          s3.push ""
+          s3.push "        member this.#{name}Entity"
+          s3.push "            with get() = this.GetGroup(Matcher.#{Name}).GetSingleEntity()"
+          s3.push ""
+          s3.push "        member this.is#{Name}"
+          s3.push "            with get() ="
+          s3.push "                notNull(this.#{name}Entity)"
+          s3.push "            and  set(value) ="
+          s3.push "                let entity = this.#{name}Entity"
+          s3.push "                if value <> notNull(entity) then"
+          s3.push "                    if value then"
+          s3.push "                        this.CreateEntity().is#{Name} <- true"
+          s3.push "                    else"
+          s3.push "                        this.DestroyEntity(entity)"
+          s3.push ""
         else
-          ex.push ""
-          ex.push "    member this.#{name}Entity"
-          ex.push "        with get() = this.GetGroup(Matcher.#{Name}).GetSingleEntity()"
-          ex.push ""
-          ex.push "    member this.#{name}"
-          ex.push "        with get() = this.#{name}Entity.#{name}"
-          ex.push ""
-          ex.push "    member this.has#{Name}"
-          ex.push "        with get() = notNull(this.#{name}Entity)"
-          ex.push ""
-          ex.push "    member this.Set#{Name}(newValue) ="
-          ex.push "        if this.has#{Name} then"
-          ex.push "            failwith \"Single Entity Exception: #{Name}\""
-          ex.push "        let entity = this.CreateEntity()"
-          ex.push "        entity.Add#{Name}(newValue) |> ignore"
-          ex.push "        entity"
-          ex.push ""
-          ex.push "    member this.Replace#{Name}(newValue) ="
-          ex.push "        let entity = this.#{name}Entity"
-          ex.push "        if isNull(entity) then"
-          ex.push "            entity = this.Set#{Name}(newValue) |> ignore"
-          ex.push "        else"
-          ex.push "            entity.Replace#{Name}(newValue) |> ignore"
-          ex.push "        entity"
-          ex.push ""
-          ex.push "    member this.Remove#{Name}() ="
-          ex.push "        this.DestroyEntity(this.#{name}Entity)"
-          ex.push ""
+          s3.push ""
+          s3.push "        member this.#{name}Entity"
+          s3.push "            with get() = this.GetGroup(Matcher.#{Name}).GetSingleEntity()"
+          s3.push ""
+          s3.push "        member this.#{name}"
+          s3.push "            with get() = this.#{name}Entity.#{name}"
+          s3.push ""
+          s3.push "        member this.has#{Name}"
+          s3.push "            with get() = notNull(this.#{name}Entity)"
+          s3.push ""
+          s3.push "        member this.Set#{Name}(newValue) ="
+          s3.push "            if this.has#{Name} then"
+          s3.push "                failwith \"Single Entity Exception: #{Name}\""
+          s3.push "            let entity = this.CreateEntity()"
+          s3.push "            entity.Add#{Name}(newValue) |> ignore"
+          s3.push "            entity"
+          s3.push ""
+          s3.push "        member this.Replace#{Name}(newValue) ="
+          s3.push "            let entity = this.#{name}Entity"
+          s3.push "            if isNull(entity) then"
+          s3.push "                entity = this.Set#{Name}(newValue) |> ignore"
+          s3.push "            else"
+          s3.push "                entity.Replace#{Name}(newValue) |> ignore"
+          s3.push "            entity"
+          s3.push ""
+          s3.push "        member this.Remove#{Name}() ="
+          s3.push "            this.DestroyEntity(this.#{name}Entity)"
+          s3.push ""
           
                
+    #
+    # ./<Namespace>.fs - Component declarations
+    # ./Systems/*.fs - System Classes
+    # ./Extensions/EntityExtensions.fs
+    # ./Extensions/MatcherExtensions.fs
+    # ./Extensions/WorldExtensions.fs
+    #               
     mkdirp.sync path.dirname(path.join(process.cwd(), config.output.fsharp))
     mkdirp.sync path.join(process.cwd(), config.output.fsharp, "Systems")
-    
-    fs.writeFileSync(path.join(process.cwd(), config.output.fsharp, "#{config.namespace}.fs"), sb.join('\n'))
-    fs.writeFileSync(path.join(process.cwd(), config.output.fsharp, "#{config.namespace}Extensions.fs"), ex.join('\n'))
-
+    mkdirp.sync path.join(process.cwd(), config.output.fsharp, "Extensions")
+    
+    # Components
+    fs.writeFileSync(path.join(process.cwd(), config.output.fsharp, 
+      "Extensions/ComponentExtensions.fs"), sb.join('\n'))
+    
+    # Extensions
+    for Name, ex of ext
+      fs.writeFileSync(path.join(process.cwd(), config.output.fsharp, 
+        "Extensions/#{Name}Extensions.fs"), ex.join('\n'))
+
+    # Systems
     for Name, sy of sys
-      fs.writeFileSync(path.join(process.cwd(), config.output.fsharp, "Systems/#{Name}.fs"), sy.join('\n'))
+      fs.writeFileSync(path.join(process.cwd(), config.output.fsharp, 
+        "Systems/#{Name}.fs"), sy.join('\n'))
       
  run: (flags...) ->

    sb = []
    ex = []
    sys = {}
    
    sb.push "namespace #{config.namespace}"
    sb.push ""
    sb.push "(**"
    sb.push " * Entitas Generated Components for #{config.namespace}"
    sb.push " *"
    sb.push " * do not edit this file"
    sb.push " *)"
    sb.push ""
    sb.push "open Entitas"
    sb.push "open System"
    sb.push "open System.Collections.Generic"
    
    ex.push "module #{config.namespace}Extensions"
    ex.push ""
    ex.push "(**"
    ex.push " * Entitas Generated Extensions for #{config.namespace}"
    ex.push " *"
    ex.push " * do not edit this file"
    ex.push " *)"
    ex.push ""
    ex.push "open Entitas"
    ex.push "open #{config.namespace}"
    ex.push "open System"
    ex.push "open System.Collections.Generic"

    ###
     * Components Type Definitions

    for Name, properties of config.components
      name = Name[0].toLowerCase()+Name[1...]
      sb.push ""
      sb.push "    [<AllowNullLiteral>]"
      sb.push "    type #{Name}Component() ="
      sb.push "        inherit Component()"
      if properties is false 
        sb.push "        member val active = false with get, set"
      else
        for p in properties
          name = p.split(':')[0]
          value = getDefault(p.split(':')[1])
          sb.push "        member val #{name} = #{value} with get, set"
      
    ###
     * Systems Type Definitions
