As many companies offering online services do, we handle multiple currencies. This often involves querying external services to know the real value of the currency exchange. Previously, this logic was scattered all over the code, even copy-pasted in multiple files, and is pretty hard to mantain, let alone to test.
So, in my work detecting and extracting patterns from old spaghetti code, I came with the following solution: A Service layer.