cleaned up timer functions