Code cleanup.

Reformat code, reorganize imports, removed some unused variables.

CC @vinodkone @bmahler