Refactor using respond_with method