Replace ugly conditionals with early return statements where applicable.