improve homebrew detection