refactoring and install