Replace os.system() with subprocess