Refactor logic for incrementing when after sunset