Rename MACHINE var into VARIANT. Remove redundant/unnecessary VARIANT setting in individual settings files.
Move helper functions to functions file. Remove helpers file.
Remove unnecessary return 0 lines - default is to return last cmd exit status. Tidy empty lines, rearrange log and local vars lines.