clean end of day code