some refactoring and fixing
 lnpm.sh refactoring