refactoring of yield_curve.py