Refactoring for more sense.
Also fixed the load permissions method being too complex.