Refactor the installation complexity into another module.

rubocop pointed the problem out :)