re-ordering code in enquiry_controller