more refactoring, this may actually work with Dart O_o