Refactor (simplify) AST building