Rework the route handler snippet