Wrap up in a function.