light messages code cleanup