This probably can be extracted to `ASTUtil`.