base-install: refactoring

Code refactoring including:
 - Factorization
 - Code isolation
 - Cleaner installation process