Looking for feedback on code

Ah, yes, testability is a useful metric for these refactorings. I haven’t actually used it myself, but ExUnit has a capture_io function that is useful. I believe this forum post and the StackOverflow answer it points to will help you. I don’t have time to put the pieces together right now, but if you have struggles post back and I’ll take a look at the details later today.