Own file for generic memoize func