Moving this to documentation due to a general consensus that abstracting this is not necessarily worth it.
If we don't want to refactor and abstract this, it is worth documenting the design as to how things work now so that others who face bugs can consult docs instead of trying to determine acceptable or recommended practices by looking at the code alone.