Refactor parsing behavior handling.