End install refactoring. Fix #1