more refactoring into smaller modules