Reduce memory usage of the stack