Try and tidy the nested conditional up