solve importing circularity
restore cache correctly
less lazy global variable