Re-write to work on distributed switches