Remove dependency on system() call.