refactor reference modal