Tighter code with date formats