refactor exception parser