refactor python.p4d