refactored currency converter