several fixes on modeling + separating mixins and utils + table_refs