improved performance and reduced memory consumption