Refactored installation of brew cask