Cli: factorize loading

std::unique_ptr whould be better