Refactor python version a bit