use ExecutorService instead of Threads directly, better implementation to check wether a span is continious and index for getting the index of a token