Refactoring response rendering