cache_tests code cleaning