install: Refactor the code a bit.