Split logic into [setup, common, service] pattern