push some of the logic out of our handler