minor refactoring for repr