cache and tests improvements