We can move this chunk under if/else to a method and reuse