add yaml static factory method.