Refactored toString Method