Rewrote refresh method for ports document.