simpler way to have python2 compatibility