Implment local and remote run