Should not be specifically dependent on shell_exec, generalise exec and use underscore prefixing for private functions