Added removeAll to simplify resource cleanup.