How to understand the functions model_delay_encode() and model_delay_decode() in light_switch example?

Hi Nordic Support Team,

uint32_t model_delay_decode(uint8_t enc_delay)
{
    return (enc_delay * DELAY_TIME_STEP_FACTOR_MS);
}

uint8_t model_delay_encode(uint32_t delay)
{
    if (delay > DELAY_TIME_STEP_MAX)
    {
        return DELAY_TIME_STEP_MAX;
    }
    else
    {
        return (delay/DELAY_TIME_STEP_FACTOR_MS);
    }
}

When decode the delay, DELAY_TIME_STEP_FACTOR_MS is used for the decoded result. However, in model_delay_encode(), if (delay > DELAY_TIME_STEP_MAX), it just returns DELAY_TIME_STEP_MAX, without being divided by DELAY_TIME_STEP_FACTOR_MS, why?  how to understand this kind of situation. 

Related