improve package generation and lib find