Tidy up result handling