Extract common incoming/outgoing store logic.