Restructure to use if/else instead of early return
Clearer indentation