speed up lifetime query, change data structure