This should really be a switch statement. But this also changes the logging. Instead of always logging, it now only does it in specific cases. Doesn't that mean we could miss things?