Refactor installer to be more modular