add factory for testing