Consolidating the light and sun lighting code