add generic_lib for code optimize