Extract cache helpers and test them