Changes to support better memory usage