Fix class method in models