Better way to handle blocks to free memory