refactor currency converter so it can be used outside