make diff a prototype, simplify caching logic