Refactoring for PR139