Extracted same code from SectorConfigure.js and SectorEdit.js into SectorCommon.js