* extract PortRelatedModel and DeviceRelatedModel * add scope for inDeviceGroup * handle null device group