diff --git a/Library/Homebrew/cmd/doctor.rb b/Library/Homebrew/cmd/doctor.rb
index 302c436cd93f7849ecdffee3c29fd85c256e8dd5..686b0b98cc0726e4707a84ddd2711b0301ef8f87 100644
--- a/Library/Homebrew/cmd/doctor.rb
+++ b/Library/Homebrew/cmd/doctor.rb
@@ -240,7 +240,7 @@ class Checks
   end
 
   def check_for_unsupported_osx
-    if !ARGV.homebrew_developer? && MacOS.version >= "10.12" then <<-EOS.undent
+    if !ARGV.homebrew_developer? && OS::Mac.prerelease? then <<-EOS.undent
     You are using OS X #{MacOS.version}.
     We do not provide support for this pre-release version.
     You may encounter build failures or other breakages.
@@ -259,8 +259,7 @@ class Checks
       end
     end
 
-    # TODO: bump version when new OS is released
-    if MacOS.version >= "10.12"
+    if OS::Mac.prerelease?
       def check_xcode_up_to_date
         if MacOS::Xcode.installed? && MacOS::Xcode.outdated?
           <<-EOS.undent
diff --git a/Library/Homebrew/exceptions.rb b/Library/Homebrew/exceptions.rb
index 29cd480d5262e0b8a2f7046ec5a201cef36c2d92..adb17fe572e84e94d3b38f3e0a935cded82b135a 100644
--- a/Library/Homebrew/exceptions.rb
+++ b/Library/Homebrew/exceptions.rb
@@ -251,7 +251,7 @@ class BuildError < RuntimeError
       puts issues.map { |i| "#{i["title"]} #{i["html_url"]}" }.join("\n")
     end
 
-    if MacOS.version >= "10.11"
+    if OS::Mac.prerelease?
       require "cmd/doctor"
       opoo Checks.new.check_for_unsupported_osx
     end
diff --git a/Library/Homebrew/os/mac.rb b/Library/Homebrew/os/mac.rb
index 3568f71588a526034013cbd366430df231e6995a..e8c2f76bc65c6b1c420f41bf8fff495a91fb3fa7 100644
--- a/Library/Homebrew/os/mac.rb
+++ b/Library/Homebrew/os/mac.rb
@@ -22,6 +22,11 @@ module OS
       @full_version ||= Version.new(`/usr/bin/sw_vers -productVersion`.chomp)
     end
 
+    def prerelease?
+      # TODO: bump version when new OS is released
+      version >= "10.12"
+    end
+
     def cat
       version.to_sym
     end
diff --git a/Library/Homebrew/os/mac/xcode.rb b/Library/Homebrew/os/mac/xcode.rb
index 8a2da48ecd25e6d2e636886c21184b39878123ae..d41dec26d50eca081c42804213c7510e10ef4f9f 100644
--- a/Library/Homebrew/os/mac/xcode.rb
+++ b/Library/Homebrew/os/mac/xcode.rb
@@ -18,7 +18,7 @@ module OS
         when "10.11" then "7.0.1"
         else
           # Default to newest known version of Xcode for unreleased OSX versions.
-          if MacOS.version > "10.11"
+          if OS::Mac.prerelease?
             "7.0.1"
           else
             raise "OS X '#{MacOS.version}' is invalid"