Improved __str__ method of factor