Adding a handler to the collector to make the code a little more flexible