Remove fatal for certain errors and refactor