Refactoring and fixes some missing file permissions for skel.