Simplify memoization function

Updates code to match: https://github.com/RayHightower/rayhightower.github.io/pull/1