Much stronger scripts, with shellcheck and () for function body