Fix duplicated codes

Change-Id: I17a783ca5219862f3efa510b4fa92b1cfe64576a