More code simplifications.
Moved code out of ASTHelper to allow further simplifications.