code cleanup and fix for timezone