cleanup and fix for datetap