refactored the threadtimer stuff