Refactored fetcher code in containerizers.

Review: https://reviews.apache.org/r/27995