Updated for local and remote operations.