adding refactor4.py