Tidy flatten-ast with the corresponding private functions.