refactoring of global lighting