light code cleanup