add a few tests and a cache mechanism