Convert c# method to function to fix the build.