[5.0] Routing : unless class check in foreach

Useless to check class for each method.