master refactoring