Added factory tests.
added spec gen.