Code cleanup to dart 17594

Signed-off-by: Daniel Thomas <drt24@cam.ac.uk>