Trying to improve memory usage