Refactor installer, add minor fixes