diff --git a/Library/Homebrew/cask/lib/hbc/cli.rb b/Library/Homebrew/cask/lib/hbc/cli.rb
index e216c70725aa34f7eb03787bd59bb647dd5d758c..6249fbc7ab2ecd9bb7e2a81273cdcfe2faf3a389 100644
--- a/Library/Homebrew/cask/lib/hbc/cli.rb
+++ b/Library/Homebrew/cask/lib/hbc/cli.rb
@@ -73,9 +73,8 @@ module Hbc
     }.freeze
 
     def self.command_classes
-      @command_classes ||= self.constants
-                               .map(&method(:const_get))
-                               .select { |sym| sym.respond_to?(:run) }
+      @command_classes ||= constants.map(&method(:const_get))
+                                    .select { |sym| sym.respond_to?(:run) }
     end
 
     def self.commands
@@ -114,7 +113,7 @@ module Hbc
         # for development and troubleshooting
         sym = Pathname.new(command.to_s).basename(".rb").to_s.capitalize
         klass = begin
-                  self.const_get(sym)
+                  const_get(sym)
                 rescue NameError
                   nil
                 end
diff --git a/Library/Homebrew/cask/lib/hbc/container.rb b/Library/Homebrew/cask/lib/hbc/container.rb
index 01dd103375a1fd9a6066d7c3973d1dd2c7b3325f..e31fbc8fb9b3d2dc6c6ea0c2690a339ee9623b9a 100644
--- a/Library/Homebrew/cask/lib/hbc/container.rb
+++ b/Library/Homebrew/cask/lib/hbc/container.rb
@@ -59,7 +59,7 @@ module Hbc
     def self.from_type(type)
       odebug "Determining which containers to use based on 'container :type'"
       begin
-        self.const_get(type.to_s.split("_").map(&:capitalize).join)
+        const_get(type.to_s.split("_").map(&:capitalize).join)
       rescue NameError
         false
       end