gems - refactor authorized and installed_authorized