minor refactor on permission