refactored how files are installed, takes into account permissions