Move captured variables into separate structure.