Helper to exec with a context