Adding factory and tests.