Cleaned up code that serializes collections and maps
More code cleanup