Reorganise models and add unique flags back in