better route handler detection