Refactor features around memory and annotations.