Refactoring manager codes