memoized / cleaned up core