Isolate model into $n factory
Merge pull request #2 from RobinBressan/fix_memory_leak

[RFR] Isolate model into $n factory