Reduce complexity of mess detector plugin execute method.

Fixes #387