Extract TimedThread and KeySequenceTreeBuilder