query_sys_status little refactor