as I said on the other comment, I think this logic (getting the next midnight) should be generic and abstracted into a single place.