Remove obsolete legacy code

Change-Id: I5692f5051c444faf21f3a04d83399f52aea0d665
Remove unused variables

Change-Id: Iab3b086bfdd7cc29ef2a2517a9ec735023632db8