Improve code style in light uniform optimization