Would this set of if/else blocks be cleaner with early return?