diff --git a/Document API/tableaudocumentapi/workbook.py b/Document API/tableaudocumentapi/workbook.py
index <HASH>..<HASH> 100644
--- a/Document API/tableaudocumentapi/workbook.py
+++ b/Document API/tableaudocumentapi/workbook.py
@@ -115,10 +115,6 @@ class Workbook(object):
 
     @staticmethod
     def _is_valid_file(filename):
-        valid = 0
         fileExtension = os.path.splitext(filename)[-1].lower()
-        if fileExtension == ".twb":
-            valid = 1
-        elif fileExtension == ".tds":
-            valid = 1
-        return valid
+        return fileExtension in ('.twb', '.tds')
+
Refactor _is_valid_file to be mroe pythonic and extensible if we add more filetypes in the future. No more C++ code in the python :)