**Describe the feature you'd like** Find duplicates and remove the common code **Additional context** https://github.com/aws/sagemaker-python-sdk/pull/4368