I couldn't study this very carefully at this moment, but why is this method so similar to `cutOutMessages`? Why this massive code duplication? You even set `deviation` in two places, which is supposed to be a tweakable variable. You should never create two functions that contains 90% of the same code. Rather create a single generic one and reuse it in all appropriate places.