Replace trait by class, change error message and mutualize method in class Url