Implemented models as functions with decorators