fix #12

* use `Formula.factory` instead of calling `new` directly
Merge pull request #13 from yewton/use-formula-factory

fix #12