add singleton factory for test.