models refactor