Merge "Refactor the code to check the metadata"
am: cbdcfc0038

Change-Id: I0b7d8a94a1e3d107a9e503c48363344209483b94