Add getters/setters for memory instead of allowing direct access.