12763 + refactoring