refactor python code into folder