Reformatted respond_to code in controller