parsing and detection