moving switch into smaller modules