Refactored gem_available method slightly