code improvements using pyflakes

Removing unused variables and several other stuffs

Change-Id: Id64b3172f25b8376e202a9bcf62d5ce4fcc8bb7e
Merge "code improvements using pyflakes"