So this is a big method. SRP and DRY is calling to you here...