refactor sem_calc_messages
global changes