[haiyang] add factory implementation