Refactored toString