Continue to abstract memory management into helper functions.