We use this pattern so often we have libraries to make it easier.