I guess you could just let Piecewise work out what to return and replace these 4 lines with this one.