Further factoring of date functions