Refactor code to be slightly less terrible.
Add new bad conditon.