This function should be removed while we aren't using static factory.