Cleaned up release of memory