refactoring to use render_to_response