Adding publish and memoize