Refactoring for anonymous model