Refactored to_roman code