improve factor to_string