rationalized the code and system() API.