More function manager refactoring