refactor: use dart idioms