Make the code more Dart like