Code cleanup, daylight handling