Version with reduced memory consumption