writing a c# version of the facility in order to reduce dependencies on external assemblies