Updating exception filters to use when instead of if