Refactor the installer script and fix #15