Cleaned up memory usage