Restore some code

Change-Id: I3df8ab92a9a5a9298c7ed533ddfb34443f882b21