Metaclass for model