DNN-5958 Refactor ServicesFramework.cs to provide helper method