refactor handlers so they handle their children