factor out common code between mono and dotnet