refactored code. added before_save filter for currency converter