minor refactoring in the @available method