More .NET container cleanup

Created a utility function to handle the building of the lookup.