Generating cache files got a little bit more object oriented