Refactored inbound_sync and endpoint to separate concerns.