Refactoring out restrict_access method