Refactored r2s_step2setup.py