timer code cleanup.