Refactor ModelField and tests