Better handling of PY2 vs PY3