Some adoptions on certficate factory