All caching implemented, not tested.