Split logic into smaller chunks