mapping logic