Refactoring to improve formula script generation.
Merge remote-tracking branch 'origin/acf' into alrd