As discussed in the meeting earlier today, I'd like to see us move to a model where this functions is a bit easier to unit test by creating logical abstractions where they make sense and mocking them during unit testing.
Totally fine with this being a follow-up, just commenting to track the recommendation :)
Originally posted by @everettraven in #846 (comment)