Add method to eliminate use of python 2.7 method