Refactoring AST node construction