Refactoring to better suit new install method.