made cache a mixin trait, updated test to use cache where needed