Revert "Remove unused factory method"

This reverts commit 7b8ef1b2a7d1a0cadc3182c6a7733cf79a4d09d3.
Remove unused factory method