refactoring toString