I added an abstraction layer here, pretty similar to retrofit's approach. Let me know if it satisfies your use case.