small code strcture refactor in manager