refactored same common structure.