Added FinancialPeriod class and refactored code