Split mutate into separate functions