Minor refactoring, remove memoization, rename things