EnsembleDynamicScheduler refactoring to delete dulpicate code and make it safer to use.