reworking models into functions
small progress