Refactoring of function manager