Fixed code formatting to follow guidelines.

Made some changes to remove warnings about generics.

Removed unused instance properties.

Change-Id: I80e97af2667b800471e7f86c8a24ed5b1524e65d