This method is too long already, could you please move this if block out of it?