Refactors python version