More compact memoisation style