update to datetime and cleanup