Refactor TimedTask