better way of supporting python 3