Python code refactoring
Minimal test case