DRYing up put/post