Fixed a problem with multiple logging handlers assigned to each client.
Refactored utils to use the match_pattern() method.