Refactored into separate getRenderedName helper function