Simplified memroy handling.