refactoring lnpm.sh