using typed AST