better to_s partially inspired by the one in the ios sdk